<?php
/**
 * 后端管理功能
 */
namespace app\controllers;

use Yii;
use yii\base\Controller;

/**
 */
class ErrorController extends Controller
{
    public function actionError()
    {
        $exception = Yii::$app->errorHandler->exception;
        $errorCode=$exception->statusCode;
        $errorMsg=Yii::$app->errorHandler->exception->getMessage();
        $errorCode=$errorCode??500;
        Yii::trace("error_code ".$errorCode. " errmsg:".$errorMsg);
        formatJson($errorCode, $errorMsg);
    }
}